{% extends "analysis_plugins/general_information.html" %}

{% block analysis_result_details %}

	{% for key in firmware.processed_analysis[selected_analysis] %}
		{% if key not in ['summary', 'plugin_version', 'system_version', 'analysis_date', 'tags', 'skipped'] %}
			<tr>
				<td class="active"> Description:</td>
				<td class="active"> {{ key }} </td>
			</tr>
			<tr>
				<td rowspan={{ firmware.processed_analysis[selected_analysis][key]['count'] + 1}}>Content:</td>
			</tr>
	    	{% for material in firmware.processed_analysis[selected_analysis][key]['material'] %}
				<tr>
                	<td style="margin:0; padding:0;">
                        <pre style="margin-bottom: 0; white-space: pre-wrap;">{{ material | safe }}</pre>
                        {# Crypto Key Search Button #}
                        {% set query = {"processed_analysis.crypto_material." + key + ".material": {"$regex": material[-50:] | regex_meta }} | json_dumps %}
                        <button class="btn btn-default btn-xs" type="button" style="margin-bottom: 10px"
                                onclick="window.location.href='{{ '/database/browse?query=' + query | urlencode }}'">
                            <span class="glyphicon glyphicon-search"></span> search for other occurrences
                        </button>
                    </td>
    	    	</tr>
    		{% endfor %}
		{% endif %}
	{% endfor %}

{% endblock %}